<!--包含头部文件-->
{include file="public/header" /}
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 团购商品申请列表 </nav>
<div class="page-container">
    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <div class="text-c">
            <form action="{:url('deal/index')}" method="get">
             <span class="select-box inline">
                <select name="category_id" class="select">
                  <option value="0">全部分类</option>
                  {volist name="categorys" id="vo"}
                  <option value="{$vo.id}" {if condition="$vo.id eq $category_id"}selected="selected"{/if}>{$vo.name}</option>
                    {/volist}
                </select>
            </span>
                <span class="select-box inline">
                <select name="city_id" class="select">
                  <option value="0">全部城市</option>
                  {volist name="citys" id="vo"}
                  <option value="{$vo.id}" {if condition="$vo.id eq $city_id"}selected="selected"{/if}>{$vo.name}</option>
                    {/volist}
                </select>
            </span> 日期范围：
                <input type="text" name="start_time" class="input-text" id="countTimestart" onfocus="selecttime(1)" value="{$start_time}" style="width:150px;" >
                -
                <input type="text" name="end_time" class="input-text" id="countTimeend" onfocus="selecttime(1)" value="{$end_time}"  style="width:150px;">
                <input type="text" name="name" id=""  value="{$name}" placeholder=" 商品名称" style="width:250px" class="input-text">
                <button name="" id="" class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜索
                </button>
            </form>
        </div>
    </div>
    <div class="mt-20">
        <table class="table table-border table-bordered table-bg table-hover table-sort">
            <thead>
            <tr class="text-c">
                <th width="80">ID</th>
                <th width="100">商户名称</th>
                <th width="30">栏目分类</th>
                <th width="40">城市</th>
                <th width="40">购买件数</th>
                <th width="80">开始结束时间</th>
                <th width="60">创建时间</th>
                <th width="60">状态</th>
                <th width="100">操作</th>
            </tr>
            </thead>
            <tbody>
            {volist name="deals" id="vo"}
            <tr class="text-c">
                <td>{$vo.id}</td>
                <td>{$vo.name}</td>
                <td>{$categoryArrs[$vo.category_id]}</td>
                <td class="text-c">{$cityArrs[$vo.sec_city_id]}</td>
                <td class="text-c">{$vo.buy_count}</td>
                <td>{$vo.start_time|date="y-m-d h:i", ###}<br />{$vo.end_time|date="y-m-d h:i", ###}</td>
                <td>{$vo.create_time}</td>
                <td class="td-status"><a href="{:url('deal/status',['id'=>$vo.id, 'status'=>1])}" title="团购审核通过">{$vo.status|status}</a></td>
                <td class="td-manage">
                    <a style="text-decoration:none" class="ml-5" onClick="system_category_edit('商户入驻详情数据','{:url('deal/detail', ['id'=>$vo.id])}')" href="javascript:;" title="查看"><i class="Hui-iconfont">&#xe6df;</i></a>
                    <a style="text-decoration:none" class="ml-5" onClick="system_category_del('{:url('deal/status',['id'=>$vo.id, 'status'=>-1])}')" href="javascript:;" title="下架"><i class="Hui-iconfont">&#xe6e2;</i>
                    </a>
                </td>
            </tr>
            {/volist}
            </tbody>
        </table>
    </div>
</div>
<div id="aqiepage">
    {:pagination($deals)}
</div>
<!--包含底部文件-->
{include file="public/foot" /}
<script type="text/javascript" src="__STATIC__/admin/hui/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script>
    function selecttime(flag) {
        if (flag == 1) {
            var endTime = $("#countTimeend").val();
            if (endTime != "") {
                WdatePicker({dateFmt: 'yyyy-MM-dd HH:mm', maxDate: endTime})
            } else {
                WdatePicker({dateFmt: 'yyyy-MM-dd HH:mm'})
            }
        } else {
            var startTime = $("#countTimestart").val();
            if (startTime != "") {
                WdatePicker({dateFmt: 'yyyy-MM-dd HH:mm', minDate: startTime})
            } else {
                WdatePicker({dateFmt: 'yyyy-MM-dd HH:mm'})
            }
        }
    }
</script>
</body>
</html>
